<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>

 <div class="sf-topMenu">
	<!-- When user does not login successfully, this DIV is not display-->	
	
	<s:if test="#session.SPRING_SECURITY_CONTEXT!=null">
	
		<%
			String userName = ((org.springframework.security.core.userdetails.UserDetails)org.springframework.security.core.context.SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getUsername();
			String menuCacheKey = "menu_" +userName+"_"+ request.getSession().getAttribute("roleCode");
		%>
		<cache:cache key="<%=menuCacheKey%>" groups="menu" >
			<s:action namespace="/home" name="home!menuBar" var="menuAction" flush="false"/>
			<s:property value="#menuAction.menu" escapeHtml="false"/>	
		</cache:cache>
	</s:if>
		
 </div>
 